package cooperated

import (
	"gddgame.cc/galaxy/common/namespaces/cooperate"
)

func (logic *TypeMap) Taunt(info InfoContainer, taunt *TauntLogic) {
	target := info.GetTarget()
	instance := logic.GetDetailCache(logic, target)
	if instance == nil {
		return
	}
	operates := []cooperate.UpdateOperateContent{{
		Operate: cooperate.ChangeParamSchedule,
		Key:     taunt.LogicKey,
		Value:   []interface{}{target.DataType, target.Id},
	}}
	// 变更目标对象: 不用还原对象，因为移动会更新
	targets := logic.findTarget(info, taunt, taunt.Position, nil, instance)
	for _, target := range targets {
		operateData := &cooperate.UpdateOperateData{
			Data:     *target.Data(),
			Operates: operates,
		}
		logic.scheduleBatchUpdateOperate2(info, operateData, -100)
	}

}
